<?php

/*
Set First Pets (admin_set_firstpets.php)
*/

$page_title = "Set First Pets";
$rank_check = 7;
include "../header.inc.php";

print "$openHTML";

$findGetFirsts = fetch("SELECT * FROM getfirst_pet WHERE game = '$game'");
$findSpecies = mysql_query("SELECT * FROM pets2 WHERE game = '$game'");
while ($getSpecies = mysql_fetch_array($findSpecies))
{
	if ($getSpecies[id] == "$findGetFirsts[getpet_1]")
	{
		$add = "<option value=$getSpecies[id] SELECTED>$getSpecies[name]</option>";
	}
	if ($getSpecies[id] == "$findGetFirsts[getpet_2]")
	{
		$add2 = "<option value=$getSpecies[id] SELECTED>$getSpecies[name]</option>";
	}

	if (!$add)
	{
		$add = "<option value=$getSpecies[id]>$getSpecies[name]</option>";
	}
	
	if (!$add2)
	{
		$add2 = "<option value=$getSpecies[id]>$getSpecies[name]</option>";
	}
	
	$petlist1 .= "$add";
	$petlist2 .= "$add2";
	
	$add = "";
	$add2 = "";
}

ECHO <<<END

<P><FORM ACTION="admin_set_firstpets.pro.php?game=$game" METHOD=POST>
   <CENTER><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=400>
      <TR BGCOLOR="$topAndBottomBG">
         <TD COLSPAN=2 HEIGHT=50>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--Setup for Get First Pet--</FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=128 HEIGHT=40>
            <P>Pet 1</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">&nbsp;<select name=pet1><option>Pick One$petlist1</select></FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG">
         <TD WIDTH=128 HEIGHT=40>
            <P>Pet 2</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">&nbsp;<select name=pet2><option>Pick One$petlist2</select></FONT></P>
         </TD>
      </TR>
      <TR>
         <TD COLSPAN=2 HEIGHT=30 BGCOLOR="$topAndBottomBG">
            <CENTER><FONT SIZE="-1" COLOR="$topAndBottomText"><I><INPUT TYPE=submit NAME=Submit VALUE="Setup Page!!"></I></FONT></CENTER>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></P>

END;

print "$closeHTML";
?>
